A Proof of Weak Termination Providing the Right Way to Terminate
نویسندگان
چکیده
We give an inductive method for proving weak innermost termination of rule-based programs, from which we automatically infer, for each successful proof, a finite strategy for data evaluation. We first present the proof principle, using an explicit induction on the termination property, to prove that any input data has at least one finite evaluation. For that, we observe proof trees built from the rewrite system, schematizing the innermost rewriting tree of any ground term, and generated with two mechanisms: abstraction, schematizing normalization of subterms, and narrowing, schematizing rewriting steps. Then, we show how, for any ground term, a normalizing rewriting strategy can be extracted from the proof trees, even if the ground term admits infinite rewriting derivations. 1 Introducing the problem In the context of programming in general, termination is a key property that warrants the existence of a result for every evaluation of a program. For rule-based programs, written in languages like ASF+SDF [19], Maude [4], Cafe-OBJ [12], or ELAN [3], data evaluation consists in exploring rewriting derivations of an input term. Strong termination, expressing that every rewriting derivation terminates, often does not hold. When for any term, there is at least one terminating derivation, the rewrite system is said to be weakly terminating. This is an interesting property for languages like ELAN , whose strategies can express that the result of the program evaluation on a data is one of its possible finite evaluations, or the first one. Weak termination then warrants a result for such evaluation strategies. Analyzing termination also allows choosing the good way to evaluate data. Indeed, if the program is strongly terminating, a depth-first evaluation can be used, while if the program is only weakly terminating, a breadth-first algorithm, often much more costly, is necessary in general. In the second case, if there is a way to find terminating branches, the breadth-first technique can be avoided, which yields a considerable gain for program executions. This is what we propose. Specific methods for proving termination of rewriting under strategies have been studied. Let us cite [2] and [13, 9] for the innermost strategy, [10] for the outermost strategy, and [8, 20] for local strategies on operators. All these works tackle the problem of strong termination. Here, we consider the weak innermost termination problem, i.e. we prove that among all innermost rewriting derivations starting from any term, one of them is finite. We focus on the innermost rewriting strategy, consisting in rewriting always at the lowest possible positions, since it is most often used as a built-in mechanism in evaluation of rule-based languages and functional languages. Like the previously cited methods, the approach presented here also gives a way to prove weak termination of standard rewriting. But to our knowledge, it is the only approach able to handle term rewriting systems (TRSs in short) that are not strongly but only weakly innermost terminating. Moreover, our method is constructive in the sense that the proof gives the strategy to follow to obtain one of the finite derivations. The weak termination property has been studied from several perspectives. For instance, B. Gramlich proved that weak termination can imply strong termination [16]. He also established conditions on TRSs for the property to be preserved by the union operation on TRSs [17]. J. Goubault-Larrecq proposed a proof of weak termination of typed Lambda-Sigma calculi in [15]. In order to illustrate the main ideas of our method on a running example, let us consider the following TRS: f(g(x), s(0)) → f(g(x), g(x)) (1) f(g(x), s(y)) → f(h(x, y), s(0)) (2) g(s(x)) → s(g(x)) (3)
منابع مشابه
Adapting functional programs to higher order logic
Higher-order logic proof systems combine functional programming with logic, providing functional programmers with a comfortable setting for the formalization of programs, specifications, and proofs. However, a possibly unfamiliar aspect of working in such an environment is that formally establishing program termination is necessary. In many cases, termination can be automatically proved, but th...
متن کاملVerifying Total Correctness of Graph Programs
GP 2 is an experimental nondeterministic programming language based on graph transformation rules, allowing for visual programming and the solving of graph problems at a high-level of abstraction. In previous work we demonstrated how to verify graph programs using a Hoare-style proof calculus, but only partial correctness was considered. In this paper, we add new proof rules and termination fun...
متن کاملThe Fourth International Workshop on Graph Computation Models
GP (for Graph Programs) is an experimental nondeterministic programming language for solving problems on graphs and graph-like structures. The language is based on graph transformation rules, allowing visual programming at a high level of abstraction. Previous work has demonstrated how to verify such programs using a Hoare-style proof system, but only partial correctness was considered. In this...
متن کاملCustomer Relationship Termination Problem for Beta-Geometric/Beta-Binomial Model of Customer Behavior
We deal with the relationship termination problem in the context of individual-level customer relationship management (CRM) and use a Markov decision process to determine the most appropriate occasion for termination of the relationship with a seemingly unprofitable customer. As a particular case, the beta-geometric/beta-binomial model is considered as the basis to define customer beha...
متن کاملIran and Iraq's Approach toward International System and Its Impact on the Initiation and Termination of Imposed War
The main hypothesis of this article is that these two countries' approach toward the structure of international system and resulting policies toward this structure have played a pivotal role to initiate and terminate the war. The authors mainly argue that Iran's critic approach toward the structure of international system and its efforts to destroy such a structure opposed by Iraq's cooperation...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2004